package autotd.gui;
import autotd.*;



import java.io.*;


public class ExtFileFilter extends javax.swing.filechooser.FileFilter {
	String ext;
	String desc;
	public ExtFileFilter(String s) {
		super();
		ext = s;
		desc = "*."+ext;
	}
	// code was adapted from an example at http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html
	public boolean accept(File f) {
		if (f.isDirectory()) {
			return true;
		}
		return f.getName().endsWith("."+ext);
	}
	public String getDescription() {
		return desc;
	}
}







